package com.tanhua.dubbo.api;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tanhua.dubbo.mappers.AnnouncementsMapper;
import com.tanhua.model.domain.Announcement;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@DubboService
public class AnnouncementsApiImpl implements AnnouncementsApi{
    @Autowired
    private AnnouncementsMapper announcementsMapper;

    //查询公告
    @Override
    public List<Announcement> announcements(Integer page, Integer pagesize) {
        Page pages = new Page(page,pagesize);
        Page selectPage = announcementsMapper.selectPage(pages, new QueryWrapper());
        return selectPage.getRecords();
    }
}
